#include <iostream>
#include <unordered_map>
using namespace std;
const int N=1000;
int stu_id[N]= {0};
int main_49()
{
    unordered_map<int,int> um;// key=id,value=index
    int n,m,p,q,start,stop,temp;;
    cin>>n>>m;
    for (int i=0; i<n ; i++ )
    {
        stu_id[i]=i+1;
        um[i+1]=i;
    }
    for (int i=0; i<m ; i++ )
    {
        cin>>p>>q;
        start=um[p];
        stop=start+q;
        temp=stu_id[start];
        if (q>0)
        {
            for (int j=start; j<stop ; j++ )
            {
                stu_id[j]=stu_id[j+1];
                um[stu_id[j+1]]--;
            }
        }
        else
        {
            for (int j=start; j>stop ; j-- )
            {
                stu_id[j]=stu_id[j-1];
                um[stu_id[j-1]]++;
            }
        }
        um[p]+=q;
        stu_id[stop]=temp;
    }
    for (int k=0; k<n ; k++ )
    {
        cout << stu_id[k] << " ";
    }
    return 0;
}
